package cn.xiaohui;
import java.io.FileWriter;
import java.io.IOException;

/*
 * 
 * 
 * 使用FileWriter将字符写入文件
 * 
 */
public class ExampleTest49 {
	public static void main(String[] args) throws Exception {
		
		//创建一个FileWriter对象用于向文件中写入数据
		FileWriter writer = new FileWriter("writer.txt");
		String string = "行万里路，读万卷书";
		writer.write(string);
		writer.write("\r\n");//换行
		writer.close();
		
	}
}
